<?php
require_once("lib/lang.inc.php");
require_once("class/db.inc.php");

session_start();
if (isset($_GET["lan"])){
	$_SESSION["lan"] = $_GET["lan"];
}
else if (empty($_SESSION["lan"])){
	$_SESSION["lan"] = "es";
}
if (isset($_GET["page"])){
	$page = $_GET["page"];
}
else{
	$page = "main";
}
//

$DB = new database();

if (isset($_SESSION["user"])){
	if ($page == "main"){
		include("includes/main.inc.php");
	}
	else if ($page == "free_time"){
		include("includes/free_time.inc.php");
    }
	else if ($page == "messages"){
		include("includes/messages.inc.php");
	}
	else if ($page == "view_mes"){
		include("includes/view_messages.inc.php");
	}
	else if ($page == "logout"){
		unset($_SESSION["user"]);
        include("styles/html/menu/logout.php");
    }
}
else{
	Header("Location: http://" . $_SERVER["HTTP_HOST"] . $_SESSION["path"]["header"] . "/goverment/index.php?page=login");
}

?>